package com.training.java.core.collection;

public class Car {

	private String VinNumber;
	private String Make;
	private String Model;

	public Car(String VinNumber, String Make, String Model) {
		this.VinNumber = VinNumber;
		this.Make = Make;
		this.Model = Model;
	}

	public String getVinNumber() {
		return VinNumber;
	}

	public String getMake() {
		return Make;
	}

	public String getModel() {
		return Model;
	}

	@Override
	public boolean equals(Object obj) {

		if (obj instanceof Car) {
			Car car2 = (Car) obj;
			return this.VinNumber.equals(car2.VinNumber);
		} else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return VinNumber.hashCode() + Make.hashCode() + Model.hashCode();

	}
}
